Skip to main content

everai app

List workers

List workers

https://everai.expvent.com/api/apps/v1/namespaces/{namespace}/apps/{name}/workers

Request

curl -X GET \
-H 'Authorization: Bearer <your_token>' \
https://everai.expvent.com/api/apps/v1/namespaces/<namespace>/apps/<name>/workers
Field NameTypeRequiredDescription
namespacestringYesnamespace name, Defaults to defualt
namestringYesapp name
showAllbooleanNo
recentDaysintegerNodisplay the workers that have existed in the between before day and now, default 2 day, value unit is day

Response

Here’s what the response payload looks like as JSON:

{
"workers": [
{
"id": "JYdCWQfbKLAhEf8WnZUY34",
"deviceId": "95fa81d0-c46c-4d77-9194-20c65eb34733",
"status": "STATUS_RUNNING",
"detailStatus": "DETAIL_STATUS_FREE",
"createdAt": "2024-09-29T09:35:18.362Z",
"launchAt": "2024-09-29T09:35:23.443Z",
"lastServeAt": "2024-09-29T09:36:02.218108Z",
"successCount": 1,
"CPUs": 2,
"memory": 1024,
"appId": "nmusD8nfVdsdc8q3cAmcbE"
},
{
"id": "LZeebuHERVEcWxfaw3z7vJ",
"deviceId": "c2f3a824-0b33-4f14-a4c1-a4e417c90755",
"status": "STATUS_RUNNING",
"detailStatus": "DETAIL_STATUS_FREE",
"createdAt": "2024-09-29T09:35:18.370Z",
"launchAt": "2024-09-29T09:35:23.547Z",
"lastServeAt": "2024-09-29T09:35:35.387883192Z",
"CPUs": 2,
"memory": 1024,
"appId": "nmusD8nfVdsdc8q3cAmcbE"
}
]
}

Worker Status

StatusDescription
STATUS_UNSPECIFIEDThe worker is unspecified.
STATUS_INITIALIZEDThe worker is initialized.
STATUS_PENDINGThe worker is pending.
STATUS_RUNNINGThe worker is running.
STATUS_TERMINATINGThe worker is terminating.
STATUS_ERRORThe worker is error.
STATUS_UNAVAILABLEThe worker is not available.
STATUS_TERMINATEDThe worker is terminated.
STATUS_CREATEDThe worker is created.

Worker Detail Status

Detail StatusDescription
DETAIL_STATUS_UNSPECIFIEDThe worker is unspecified.
DETAIL_STATUS_IN_FLIGHTThe worker is creating.
DETAIL_STATUS_REMOVEThe worker is removing.
DETAIL_STATUS_ROLLINThe new worker is rolling in.
DETAIL_STATUS_BUSYThe worker is busy.
DETAIL_STATUS_FREEThe worker is free.

Scale down workers

Scale down workers

https://everai.expvent.com/api/apps/v1/namespaces/{namespace}/apps/{name}/workers:scale-down

Request

curl -X POST \
-H 'Authorization: Bearer <your_token>' \
-d '{"scaleDownWorkersNum": "<scaleDownWorkersNum>", "workerIds": ["<workerIds>"]}' \
https://everai.expvent.com/api/apps/v1/namespaces/<namespace>/apps/<name>/workers:scale-down
Field NameTypeRequiredDescription
namespacestringYesnamespace name, Defaults to defualt
namestringYesapp name
scaleDownWorkersNumstringNo
workerIdsarray[string]Yes

Response

Here’s what the response payload looks like as JSON:

{}

Scale up workers

Scale up workers

https://everai.expvent.com/api/apps/v1/namespaces/{namespace}/apps/{name}/workers:scale-up

Request

curl -X POST \
-H 'Authorization: Bearer <your_token>' \
-d '{"scaleUpWorkersNum": "<scaleUpWorkersNum>"}' \
https://everai.expvent.com/api/apps/v1/namespaces/<namespace>/apps/<name>/workers:scale-up
Field NameTypeRequiredDescription
namespacestringYesnamespace name, Defaults to defualt
namestringYesapp name
scaleUpWorkersNumstringNo

Response

Here’s what the response payload looks like as JSON:

{
"workerIds": [
"5oSaHwT5Y9TmrocstmfWWj"
]
}